<html>
	<head>
		<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1,minimum-scale=1, width=device-width" />
		<include file="./Application/Home/View/Default/header/header.html"/>
	</head>
	<body>
		<div class="col-xs-12 text-center index_top none-both-padding">
			<div class="col-xs-4 search"></div>
			<div class="col-xs-4">注册</div>
			<div class="col-xs-4"></div>
		</div>

	
		<div class="col-xs-12 login_content">
			<div class="col-xs-12 input_box">
				<span>用户账号：</span><input type="text" name="user_name" value="">
			</div>
			<div class="col-xs-12 input_box">
				<span>用户密码：</span><input type="password" name="user_password" value="">
			</div>

			<div class="col-xs-12 input_box">
				<span>手机号码：</span><input type="number" name="user_phone" value="">
			</div>
			
			<div class="col-xs-12 input_box">
				<span>电子邮箱：</span><input type="text" name="user_email" value="">
			</div>

			<div class="col-xs-12 emphasis_box">
				<span class="emphasis">*</span><span>手机号码与电子邮箱将用于联系您的方式 请填写真实信息 否则造成的无法沟通 本站拒不负责</span>
			</div>

			<!-- <div class="col-xs-12 input_code">
				<span>验证码：</span><input type="number" value=""><span><input type="text" value="发送验证码" readonly="readonly"></span>
			</div> -->

			<div class="col-xs-12 login_button">
				<button>注册</button>
			</div>
			
			<div class="col-xs-12 text-center register_login">
				<a href="/home/index/user_login">返回登陆</a>
			</div>
		</div>
		
		<include file="./Application/Home/View/Default/header/footer.html"/>
		
	<script>
		$(".login_button button").click(function(){
			var user_name = $("input[name='user_name']").val();
			var user_password = $("input[name='user_password']").val();
			var user_phone = $("input[name='user_phone']").val();
			var user_email = $("input[name='user_email']").val();
			if(user_name && user_password && user_phone && user_email != ""){
				$.ajax({
					url:"/home/index/signup",
					type:'post',
					dataType:'json',
					data:{'username':user_name,'password':user_password,'mobile':user_phone,'email':user_email},
					success:function(data){
						if(data.code == 200){
							alert(data.msg);
						}else{
							alert(data.msg);
							location.href = "/home/index/user_login";
						}
					}
				})
			}else{
				alert("请完整填写信息")
			}
		})
	</script>
</body>
</html>